<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" template="template.xhtml">

	<ui:define name="main">
		<div class="header header_responsavel" />
		<h:form prependid="false" id="formDashboardResponsavel">
			<p:panel id="painelConsultaAluno" header="#{msgs.aluno}">
				<p:dataTable var="aluno" value="#{dashboardResponsavelBean.alunos}"
					selection="#{dashboardResponsavelBean.alunoSelecionado}"
					emptyMessage="#{msgs.pesquisa_vazia}#{msgs.dois_pontos}"
					selectionMode="single" onRowSelectUpdate="formDashboardResponsavel"
					paginator="true" paginatorPosition="bottom"
					firstPageLinkLabel="Primeira" previousPageLinkLabel="Anterior"
					nextPageLinkLabel="Proxima" lastPageLinkLabel="ultima" rows="5">
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.ra}#{msgs.dois_pontos}" filterBy="#{aluno.ra}"
						filterMatchMode="contains" footerText="#{msgs.contem}">
						<h:outputText value="#{aluno.ra}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.nome_aluno}#{msgs.dois_pontos}"
						filterBy="#{aluno.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{aluno.nome}" styleClass="letra1" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.data_nascimento}#{msgs.dois_pontos}"
						filterBy="#{aluno.dataNasc}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{aluno.dataNasc}" >
						<f:convertDateTime pattern="dd/MM/yyyy"></f:convertDateTime>
						</h:outputText>
					</p:column>
					<!-- 
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.baixa_fotografia}#{msgs.dois_pontos}">
						<p:commandLink ajax="false" title="Download">
							<p:graphicImage value="#{alunoBean.fotoExibicao}" width="50px"
								height="50px" />
							<p:fileDownload value="#{alunoBean.foto}" />
						</p:commandLink>
					</p:column>
					 -->
				</p:dataTable>
				<h:panelGrid styleClass="painelBotoes" columns="3">
					<p:commandButton value="#{msgs.botao_visualizar_cameras}"
						action="visualizacao_cameras" ajax="false"/>
					<p:commandButton value="#{msgs.botao_enviar_recado}"
						action="#{recadosBean.iniciarRecadosResponsavel(dashboardResponsavelBean.alunoSelecionado,dashboardResponsavelBean.responsavel)}" ajax="false" disabled="#{empty dashboardResponsavelBean.alunoSelecionado}"/>
					<p:commandButton value="#{msgs.botao_consultar_nota_agenda}"
						action="consulta_lcto_agenda" ajax="false"  disabled="#{empty dashboardResponsavelBean.alunoSelecionado}"/>
				</h:panelGrid>
			</p:panel>
			<h:panelGrid style="height:100px" columns="2" rendered="#{empty dashboardResponsavelBean.alunoSelecionado}">
			</h:panelGrid>
			
			<p:panel id="painelConsulta" header="#{msgs.recados_recebidos}"
				rendered="#{not empty dashboardResponsavelBean.alunoSelecionado}"
				styleClass="painelConsulta">
				<p:dataTable var="recado"
					value="#{recadosBean.obterRecadosProfessor(dashboardResponsavelBean.alunoSelecionado)}"
					emptyMessage="#{msgs.pesquisa_vazia}#{msgs.dois_pontos}"
					paginator="true" paginatorPosition="bottom"
					firstPageLinkLabel="Primeira" previousPageLinkLabel="Anterior"
					nextPageLinkLabel="Proxima" lastPageLinkLabel="ultima" rows="5">
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.data}#{msgs.dois_pontos}"
						filterBy="#{recado.dataRecado}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.dataRecado}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.recado}#{msgs.dois_pontos}"
						filterBy="#{recado.descRecado}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.descRecado}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.professor}#{msgs.dois_pontos}"
						filterBy="#{recado.fkProfessor.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.fkProfessor.nome}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.responsavel}#{msgs.dois_pontos}"
						filterBy="#{recado.fkResponsavel.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.fkResponsavel.nome}" />
					</p:column>
				</p:dataTable>
			</p:panel>
			<p:panel  header="#{msgs.recados_enviados}"
				rendered="#{not empty dashboardResponsavelBean.alunoSelecionado}">
				<p:dataTable var="recado"
					value="#{recadosBean.obterRecadosResponsavel(dashboardResponsavelBean.alunoSelecionado)}"
					emptyMessage="#{msgs.pesquisa_vazia}#{msgs.dois_pontos}" paginator="true" paginatorPosition="bottom"
					firstPageLinkLabel="Primeira" previousPageLinkLabel="Anterior"
					nextPageLinkLabel="Proxima" lastPageLinkLabel="ultima" rows="5">
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.data}#{msgs.dois_pontos}"
						filterBy="#{recado.dataRecado}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.dataRecado}" >
							<f:convertDateTime pattern="dd/MM/yyyy"></f:convertDateTime>
						</h:outputText>
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.recado}#{msgs.dois_pontos}"
						filterBy="#{recado.descRecado}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.descRecado}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.professor}#{msgs.dois_pontos}"
						filterBy="#{recado.fkProfessor.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.fkProfessor.nome}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.responsavel}#{msgs.dois_pontos}"
						filterBy="#{recado.fkResponsavel.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{recado.fkResponsavel.nome}" />
					</p:column>
				</p:dataTable>
			</p:panel>
			
		</h:form>
	</ui:define>
</ui:composition>
